#ifndef __COMMAND_BUFFER_H__
#define __COMMAND_BUFFER_H__


class CommandBuffer
{
public:
	void init();
	void add_text( char* text );
	void insert_text( char* text );
	void add_eary_commands( bool clear );
	void add_late_commands( void );
	void copy_to_defer( void );
	void insert_from_defer( void );

	int get_maxsize();
	int get_cursize();
	
private:
	char *cmd_text;
	byte cmd_text_buf[8192];
	byte defer_text_buf[8192];
	bool	allowoverflow;	// if false, do a error
	bool	overflowed;		// set to true if the buffer size failed
	byte	*data;
	int		maxsize;
	int		cursize;
	int		readcount;
};



#endif